package heima3_2.cn.osc.ui.activity;

import android.app.Activity;
import android.os.Bundle;
import android.view.MenuItem;
import android.widget.ImageButton;

import android.widget.TextView;

import net.oschina.app.R;

import butterknife.Bind;
import butterknife.ButterKnife;
import butterknife.OnClick;
import heima3_2.cn.osc.presenter.FriendsPresenter;
import heima3_2.cn.osc.ui.adapter.FriendsAdapater;
import heima3_2.cn.osc.ui.view.RefreshListView;
/**
 * Created by emily on 2017/1/15.
 */
public class FriendsActivity extends Activity {
    @Bind(R.id.btn_back)
    ImageButton btnBack;
    @Bind(R.id.tv_title)
    TextView tvTitle;
    @Bind(R.id.loading_view)
    RefreshListView loadingView;
    private FriendsPresenter friendsPresenter;
    public  FriendsAdapater friendsAdapater;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.find_fragment_friendsgroup_activity);
        ButterKnife.bind(this);
        friendsPresenter = new FriendsPresenter(this);
        friendsPresenter.getData(0);
        friendsAdapater = new FriendsAdapater(this,null);
        loadingView.setAdapter(friendsAdapater);
}
    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        switch (item.getItemId()) {
            case android.R.id.home:
                finish();
                break;
        }
        return super.onOptionsItemSelected(item);
    }

    @OnClick(R.id.btn_back)
    public void onClick() {
        finish();
    }
}
